{{ define "title" }}
{{- T "allCategories" -}}
{{ end }}

{{ define "main"}}

{{ partial "header.html" . }}

<div class="ui container">
  <article class="ui segment dream-categories-section">
    <h2 class="ui header">
      {{- T "allCategories" -}}
      <span class="ui grey sub header">
        {{- if eq (len .Data.Terms) 1 -}}
        {{ T "category" 1 }}
        {{- else -}}
        {{ T "category" (len .Data.Terms) }}
        {{- end -}}
      </span>
    </h2>

    {{ range .Data.Terms.Alphabetical }}
    <h3 class="ui header">
      <a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a>&nbsp;{{- T "article" .Count -}}
    </h3>
    <ul>
      {{ range .Pages }}
      <li>
        <a href="{{ .RelPermalink }}">{{ .Title }}</a>
      </li>
      {{ end }}
    </ul>
    {{ end }}
  </article>
</div>
{{ end }}
